Keep current class context while calling dynamic function